<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>设置下拉框中的默认随机选中项，自己书写结构和js。</title>
</head>
<body>
    <select  id="select">
        <option value="">五条悟</option>
        <option value="">虎杖</option>
        <option value="">狗卷</option>
        <option value="">孙悟饭</option>
        <option value="">贝吉塔</option>
        <option value="">漩涡鸣人</option>
        <option value="">卡卡西</option>
        <option value="">玛琪玛</option>
    </select>
    <script>
        var selectList = document.getElementById("select").children;
        var roll = parseInt(7 * Math.random())
        selectList[roll].selected = true
    </script>
</body>
</html>